/**
 * @author 赵希奥
 * @date 2022/3/31 1:35
 * @gitHub https://github.com/CKXGZXA
 * @gitee https://gitee.com/ckxgzxa
 * @description: 学生类, 充当叶子构件类
 */
public class Student extends SchoolComponent {
    private String name;

    public Student(String name) {
        this.name = name;
    }

    @Override
    public void add(SchoolComponent component) {
        System.out.println("对不起, 不支持该方法!");
    }

    @Override
    public void remove(SchoolComponent component) {
        System.out.println("对不起, 不支持该方法!");
    }

    @Override
    public SchoolComponent getChild(int i) {
        System.out.println("对不起, 不支持该方法!");
        return null;
    }

    @Override
    public void notice() {
        System.out.println("    ----学生" + name + "已通知");
    }
}
